<include file='Base:header' />
  <link rel="stylesheet" href="__CSS__/idangerous.swiper.css">
  <link href="__CSS__/detail.css" rel="stylesheet">
  <style>
hr{border-bottom: 1px solid #111111;width:312px;}
dd{margin-left:0;}
.product-item {margin-right: 20px;}
.lastest-product{margin-right: 22px;}
  </style>

  <!--内容范围 开始-->
  <section class="content-wrap">
    <div class="container">
      <div class="row-fluid main-content">
        <!--<ul class="nav nav-pills">
          <li class="subtitle active">
            <a href="#">全部</a>
          </li>
          <li class="subtitle"><a href="#">新品</a></li>
          <li class="logo-cont"><img src="__IMG__/logo.jpg" alt=""></li>
          <li class="subtitle"><a href="#">礼盒</a></li>
          <li class="subtitle"><a href="#">护肤技巧</a></li>
        </ul>-->
        <!--面包屑-->
        <ul class="breadcrumb" style='padding-left: 0;'>
       	  <li><a href="__APP__">首頁</a><span class="divider">/</span></li>
          <volist name='data.visit_path' id='vo'>
	          	<eq name='crumbs_cur' value="$vo[term_id]">
		          	<li class="active">{$vo.name}</li>
		          	<else />
		          <li>
		          	<a href="{$vo.url}">{$vo.name}</a>
		          	<span class="divider">/</span>
		          </li>
	          	</eq>
          </volist>
        </ul>
        <div class="span12 row-fluid" style="margin-left: 0px">
          <div class="span7">
            <!--轮播图 开始-->
            <!-- 注意：大图和预览图的图片顺序和数量要一致 -->
            <div class="pc-slide">
              <!--大图 开始-->
              <div class="view">
                <div class="swiper-container">
                  <a class="arrow-left" href="#"></a>
                  <a class="arrow-right" href="#"></a>
                  <div class="swiper-wrapper">
                    <!--可循环元素 开始-->
                    <volist name='data.detail.photo' id='vo'>
	                    <div class="swiper-slide">
	                      <a href="javascript:;" target="_blank">
	                        <img src="{$vo}" style='width:721px;height:451px'>
	                      </a>
	                    </div>
                    </volist>
                    <!--可循环元素 结束-->

                  </div>
                </div>
              </div>
              <!--大图 开始-->
              <!--预览图 开始-->
              <div class="preview">
                <a class="arrow-left" href="#"></a>
                <a class="arrow-right" href="#"></a>
                <div class="swiper-container">
                  <div class="swiper-wrapper">
                    <!--可循环元素 开始-->
                    <volist name='data.detail.photo' id='vo'>
                    <div class="swiper-slide {$key==0 ? 'active-nav' : ''}">
                      <img src="{$vo}" style='width:126px;height:79px;'>
                    </div>
                    </volist>
                    <!--可循环元素 结束-->

                  </div>
                </div>
              </div>
              <!--预览图 结束-->
            </div>
            <!--轮播图 结束-->
          </div>
          <div class="span5 description">
            <h3>{$data.detail.post_title}</h3>
            <span class="price">¥<span id='price'> {$data.detail.post_price.0.price}</span></span>
            <span class="price"> {$data.detail.post_weight}</span>
            <div class="type">
              <!--<i class="type-text">COLOR</i>-->
                 <notempty name='data.detail.post_price.0.color'>
              <div class="btn-group">
                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                  <span id='checolor'>{$data.detail.post_price.0.color}</span>
                  <span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                  <!-- dropdown menu links -->
		                  <volist name='data.detail.post_price' id='vo'>
			                  <li><a href="javascript:;">{$vo.color}</a></li>
		                  </volist>
                </ul>
              </div>
               	</notempty>	
            </div>

            <div class="distribution-cont">
              <!--<div class="distribution-title"> 商品销售渠道</div>-->
              <hr/>
              <div class="contact">聯繫我們 +86 13000000000</div>
              <div class="row-fluid sns-contact">
                <a href="">
                  <img src="__IMG__/detail/contact-1.png" alt="">
                </a>
                <a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fallsin18k.com.hk%2F" target="_blank" >
                  <img src="__IMG__/detail/contact-2.png" alt="">
                </a>
                <a href="http://plurk.com/?qualifier=shares&status=http%3A%2F%2Fallsin18k.com.hk%2F" target="_blank">
                  <img src="__IMG__/detail/contact-3.png" alt="">
                </a>
                <a href="http://twitter.com/home/?status=http%3A%2F%2Fallsin18k.com.hk%2F" target="_blank">
                  <img src="__IMG__/detail/contact-4.png" alt="">
                </a>
              </div>
            </div>
          </div>
        </div>
        <notempty name='data.detail.video'>
        	<volist name='data.detail.video' id='vo'>

		        <div class="span12 video-block" style="margin-left: 0px">
		          <div class="video-cont">
		          	<video src="{$vo}" controls="controls" style='width: 100%; height:100%;'></video>
		          </div>
		        </div>
        	</volist>
        </notempty>
        <!--商品描述 开始-->
        <div class="span12 product-detail" style="margin-left: 0px">
          <h3>商品描述</h3>
<!--           <div class="span4" style="margin-left: 0px">
            <dl>
              <dt>说明</dt>
              <dd>{$data.detail.post_excerpt}</dd>
            </dl> -->
          </div>
          <div class="span12">
            <dl>
              <!-- <dt>特点</dt> -->
              <dd>{$data.detail.post_content}</dd>
            </dl>
          </div>
<!--           <div class="span4">
            <dl>
              <dt>规则</dt>
              <dd>编号：{$data.detail.post_sn}
                <br/>
                	大小:{$data.detail.post_size}
                <br/>
                	重量:{$data.detail.post_weight}
              </dd>
            </dl>
          </div> -->
        </div>
        <!--商品描述 结束-->
        <!--相关产品 开始-->
        <notempty name='data.related'>
        
	        <div class="span12 row-fluid product-row" style="margin-left: 0px">
	          <h3>相關產品</h3>
	          <!--可循环部分 开始-->
	          <volist name='data.related' id='vo'>
	          	<php>
	          		$price = json_decode($vo[post_price],true);
	          	</php>
		          <div class="span4 product-item" style="margin-left: 0px">
		            <a href="{:jump_detail($vo[id],$vo[href])}"><img src="{$vo.thumb}" style='width:380px;height:330px'></a>
		            <div class="text-cont clearfix">
		              <div class="name-price">
		                <span class="name">{$vo.post_title}</span>
		                <span class="price">¥ {$price[0][price]} - {$vo.post_weight}</span>
		              </div>
		            </div>
		          </div>
	          </volist>
	          <!--可循环部分 结束-->
	        </div>
        </notempty>
        <!--相关产品 结束-->
        <!--最近 开始-->
        <notempty name='data.last_visit'>
        
	        <div class="span12 row-fluid product-row" style="margin-left: 0px">
	          <h3>最近瀏覽</h3>
	          <!--可循环部分 开始-->
	          <volist name='data.last_visit' id='vo'>
		            <php>
		          		$price = json_decode($vo[post_price],true);
		          	</php>
		          <div class="span2 lastest-product" style="margin-left: 0px">
		            <a href="{:jump_detail($vo[id],$vo[href])}"><img src="{$vo.thumb}" style='width:191px;height:166px;'></a>
		            <div class="text-cont clearfix">
		              <div class="name-price">
		                <span class="name">{$vo.post_title}</span>
		                <span class="price">¥ {$price[0][price]} - {$vo.post_weight}</span>
		              </div>
		            </div>
		          </div>
	          </volist>
	          <!--可循环部分 结束-->
	
	        </div>
        </notempty>
        <!--最近 结束-->
      </div>
    </div>
  </section>
  <!--内容范围 结束-->


<script src="__JS__/idangerous.swiper.min.js"></script>
  <script>
  //切换价格
	var _colorobj = JSON.parse('{:json_encode($data[detail][post_price])}');
	$('.dropdown-menu li a').click(function(){
		var color = $(this).text();
		$('#checolor').text(color);
		for(var i = 0;i < _colorobj.length; i++) {
			if (color == _colorobj[i]['color']){
				$('#price').text(_colorobj[i]['price']);
			}
			}
	})

  <!--轮播图 js-->
    var viewSwiper = new Swiper('.view .swiper-container', {
      onSlideChangeStart: function () {
        updateNavPosition()
      }
    })

    $('.view .arrow-left,.preview .arrow-left').on('click', function (e) {
      e.preventDefault()
      if (viewSwiper.activeIndex == 0) {
        viewSwiper.swipeTo(viewSwiper.slides.length - 1, 1000);
        return
      }
      viewSwiper.swipePrev()
    })
    $('.view .arrow-right,.preview .arrow-right').on('click', function (e) {
      e.preventDefault()
      if (viewSwiper.activeIndex == viewSwiper.slides.length - 1) {
        viewSwiper.swipeTo(0, 1000);
        return
      }
      viewSwiper.swipeNext()
    })

    var previewSwiper = new Swiper('.preview .swiper-container', {
      visibilityFullFit: true,
      slidesPerView    : "auto",
      onlyExternal     : true,
      onSlideClick     : function () {
        viewSwiper.swipeTo(previewSwiper.clickedSlideIndex)
      }
    })

    function updateNavPosition() {
      $('.preview .active-nav').removeClass('active-nav')
      var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav')
      if (!activeNav.hasClass('swiper-slide-visible')) {
        if (activeNav.index() > previewSwiper.activeIndex) {
          var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1
          previewSwiper.swipeTo(activeNav.index() - thumbsPerNav)
        } else {
          previewSwiper.swipeTo(activeNav.index())
        }
      }
    }
  </script>
<include file='Base:footer' />